<html>
<head>
</head>
<body onload="ol.setConsoleLoggingEnabled(document.getElementById('consoleLogging').checked);">
<script src="OfficeLauncher.js" type="text/javascript"></script>
<script>
// instantiate the OfficeLauncher object
var ol = new OfficeLauncher();
function editDoc()
{
    var result = ol.EditDocument(document.getElementById('openUrl').value);
    if(result)
    {
        alert("Successfully passed URL to Office for editing.");
    }
    else
    {
        if(ol.isControlBlocked())
        {
            alert("Please allow the Plug-In to run.");
        }
        else
        {
            alert("Failed passing URL to Office for editing.");
        }
    }
}
function viewDoc()
{
    var result = ol.ViewDocument(document.getElementById('openUrl').value);
    if(result)
    {
        alert("Successfully passed URL to Office for viewing.");
    }
    else
    {
        if(ol.isControlBlocked())
        {
            alert("Please allow the Plug-In to run.");
        }
        else
        {
            alert("Failed passing URL to Office for viewing.");
        }
    }
}
function checkAvailability()
{
    var available = ol.isAvailable();
    document.getElementById('availability').innerHTML = available ? "yes" : no;
}
</script>
<p>
Document:<br/>
URL <input type="text" name="openUrl" id="openUrl" size="100" /><br/>
<input type="checkbox" name="consoleLogging" id="consoleLogging" onclick="ol.setConsoleLoggingEnabled(this.checked);" /> Debug console logging<br/>
<button type="button" onclick="editDoc();">Edit</button> &nbsp; &nbsp; <button type="button" onclick="viewDoc();">View</button>
</p>
<p>
Availability:<br/>
<button type="button" onclick="checkAvailability();">Detect</button> &nbsp; &nbsp; Availability: <span id="availability">Undetected</span><br/>
</p>
<p>
Rules:<br/>
Rule Set <input type="text" name="ruleSet" id="ruleSet" size="100" /><br/>
<button type="button" onclick="ol.setRules(document.getElementById('ruleSet').value);">Replace</button> &nbsp; &nbsp; <button type="button" onclick="ol.addRules(document.getElementById('ruleSet').value);">Add</button>
</p>
</body>
</html>